{
 "nbformat": 4,
 "nbformat_minor": 2,
 "metadata": {
  "language_info": {
   "name": "python",
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "version": "3.7.7-final"
  },
  "orig_nbformat": 2,
  "file_extension": ".py",
  "mimetype": "text/x-python",
  "name": "python",
  "npconvert_exporter": "python",
  "pygments_lexer": "ipython3",
  "version": 3,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3"
  }
 },
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "sheet1=pd.read_excel('./超市营业额2.xlsx','Sheet1')\n",
    "sheet2=pd.read_excel('./超市营业额2.xlsx','Sheet2')\n",
    "sheet3=pd.read_excel('./超市营业额2.xlsx','Sheet3')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": "       工号 姓名_x          日期           时段     交易额    柜台 姓名_y  职级\n0    1001   张三  2019-03-01   9：00-14：00  1664.0   化妆品   张三  店长\n1    1001   张三  2019-03-01  14：00-21：00  1442.0  蔬菜水果   张三  店长\n2    1001   张三  2019-03-02   9：00-14：00  1530.0   化妆品   张三  店长\n3    1001   张三  2019-03-03   9：00-14：00  1361.0   化妆品   张三  店长\n4    1001   张三  2019-03-04   9：00-14：00  1216.0   化妆品   张三  店长\n..    ...  ...         ...          ...     ...   ...  ...  ..\n252  1006   钱八  2019-03-30  14：00-21：00  1090.0    食品   钱八  员工\n253  1006   钱八  2019-03-31  14：00-21：00   812.0    食品   钱八  员工\n254  1006   钱八  2019-04-01  14：00-21：00  1321.0   日用品   钱八  员工\n255  1007   孙九  2019-04-01   9：00-14：00  1364.0  蔬菜水果   孙九  员工\n256  1007   孙九  2019-04-01  14：00-21：00  1633.0  蔬菜水果   孙九  员工\n\n[257 rows x 8 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>工号</th>\n      <th>姓名_x</th>\n      <th>日期</th>\n      <th>时段</th>\n      <th>交易额</th>\n      <th>柜台</th>\n      <th>姓名_y</th>\n      <th>职级</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1001</td>\n      <td>张三</td>\n      <td>2019-03-01</td>\n      <td>9：00-14：00</td>\n      <td>1664.0</td>\n      <td>化妆品</td>\n      <td>张三</td>\n      <td>店长</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1001</td>\n      <td>张三</td>\n      <td>2019-03-01</td>\n      <td>14：00-21：00</td>\n      <td>1442.0</td>\n      <td>蔬菜水果</td>\n      <td>张三</td>\n      <td>店长</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>1001</td>\n      <td>张三</td>\n      <td>2019-03-02</td>\n      <td>9：00-14：00</td>\n      <td>1530.0</td>\n      <td>化妆品</td>\n      <td>张三</td>\n      <td>店长</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1001</td>\n      <td>张三</td>\n      <td>2019-03-03</td>\n      <td>9：00-14：00</td>\n      <td>1361.0</td>\n      <td>化妆品</td>\n      <td>张三</td>\n      <td>店长</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1001</td>\n      <td>张三</td>\n      <td>2019-03-04</td>\n      <td>9：00-14：00</td>\n      <td>1216.0</td>\n      <td>化妆品</td>\n      <td>张三</td>\n      <td>店长</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>252</th>\n      <td>1006</td>\n      <td>钱八</td>\n      <td>2019-03-30</td>\n      <td>14：00-21：00</td>\n      <td>1090.0</td>\n      <td>食品</td>\n      <td>钱八</td>\n      <td>员工</td>\n    </tr>\n    <tr>\n      <th>253</th>\n      <td>1006</td>\n      <td>钱八</td>\n      <td>2019-03-31</td>\n      <td>14：00-21：00</td>\n      <td>812.0</td>\n      <td>食品</td>\n      <td>钱八</td>\n      <td>员工</td>\n    </tr>\n    <tr>\n      <th>254</th>\n      <td>1006</td>\n      <td>钱八</td>\n      <td>2019-04-01</td>\n      <td>14：00-21：00</td>\n      <td>1321.0</td>\n      <td>日用品</td>\n      <td>钱八</td>\n      <td>员工</td>\n    </tr>\n    <tr>\n      <th>255</th>\n      <td>1007</td>\n      <td>孙九</td>\n      <td>2019-04-01</td>\n      <td>9：00-14：00</td>\n      <td>1364.0</td>\n      <td>蔬菜水果</td>\n      <td>孙九</td>\n      <td>员工</td>\n    </tr>\n    <tr>\n      <th>256</th>\n      <td>1007</td>\n      <td>孙九</td>\n      <td>2019-04-01</td>\n      <td>14：00-21：00</td>\n      <td>1633.0</td>\n      <td>蔬菜水果</td>\n      <td>孙九</td>\n      <td>员工</td>\n    </tr>\n  </tbody>\n</table>\n<p>257 rows × 8 columns</p>\n</div>"
     },
     "metadata": {},
     "execution_count": 3
    }
   ],
   "source": [
    "result=pd.merge(sheet1.append(sheet2),sheet3,on='工号')\n",
    "result"
   ]
  }
 ]
}